package org.jit.banking;

/**
 * @author 水杉metasequoia
 */
public class Account {
    protected double balance;

    public Account(){ this.balance = 10000;   }
    public Account(double balance){
        this.balance = balance;
    }

    public double getBalance() {
        return balance;
    }

    public boolean deposit(double amt){
        balance += amt;
        System.out.println("钱已存入。");
        return true;
    }

    public boolean withdraw(double amt){
        if(amt<=balance) {
            balance -= amt;
            System.out.println("钱已取出。");
            return true;
        }
        else{
            System.out.println("余额不足！");
            return false;
        }
    }

}
